{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import arcpy"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "pnt = arcpy.Point(116.403927,39.915087)\n",
    "sr = arcpy.SpatialReference(4326)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "ename": "AttributeError",
     "evalue": "DescribeGeometry: Read-only attribute geometry",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mAttributeError\u001b[0m                            Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-8-b0beba01e0b8>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mgeo\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0marcpy\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mGeometry\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mgeometry\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;34m\"point\"\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0minputs\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mpnt\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0mspatial_reference\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0msr\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[1;32mD:\\workspace\\ArcGIS\\Pro\\Resources\\ArcPy\\arcpy\\arcobjects\\mixins.py\u001b[0m in \u001b[0;36m__init__\u001b[1;34m(self, *args, **kwargs)\u001b[0m\n\u001b[0;32m    224\u001b[0m                                                *gp_fixargs(args, True))\n\u001b[0;32m    225\u001b[0m         \u001b[1;32mfor\u001b[0m \u001b[0mattr\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mvalue\u001b[0m \u001b[1;32min\u001b[0m \u001b[0mkwargs\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mitems\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 226\u001b[1;33m             \u001b[0msetattr\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_arc_object\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mattr\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mvalue\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m    227\u001b[0m         \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_go\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    228\u001b[0m     \u001b[1;32mdef\u001b[0m \u001b[0m__eq__\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mother\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;31mAttributeError\u001b[0m: DescribeGeometry: Read-only attribute geometry"
     ]
    }
   ],
   "source": [
    "geo = arcpy.Geometry(geometry=\"point\",inputs=pnt,spatial_reference=sr)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on function buffer in module arcpy.arcobjects.arcobjects:\n",
      "\n",
      "buffer(self, distance)\n",
      "    Geometry.buffer(distance)\n",
      "    \n",
      "    Constructs a polygon at a specified distance from the geometry.\n",
      "    Buffer operator\n",
      "    \n",
      "      distance(Double):\n",
      "    The buffer distance.\n",
      "    \n",
      "    The buffer distance is in the same units as the geometry that\n",
      "    is being buffered.\n",
      "    \n",
      "    A negative distance can only be specified against a polygon geometry.\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help(arcpy.Geometry.buffer)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "shp = \"../data/beijing/bj_area.shp\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "geom = arcpy.CopyFeatures_management(shp,arcpy.Geometry())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.1413327100369368\n",
      "0.04929256686486413\n",
      "0.105407831656353\n",
      "0.004413655855237171\n",
      "0.20334096638886268\n",
      "0.031599769486657006\n",
      "0.21380649229694387\n",
      "0.14605575146040722\n",
      "0.21612961088651836\n",
      "0.08995023012564182\n",
      "0.009014096160515898\n",
      "0.10676769617903346\n",
      "0.09556194893207177\n",
      "0.005233896988097351\n",
      "0.19449688473772014\n",
      "0.045410438509695734\n"
     ]
    }
   ],
   "source": [
    "for g in geom:\n",
    "    print(g.area)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3.7.11 ('base')",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.11"
  },
  "orig_nbformat": 4,
  "vscode": {
   "interpreter": {
    "hash": "06b308fdbfd5979111721ebbf4de1ae2cbf405c7740d4ab5c57cb4c3e518bed6"
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
